﻿<%template _header%>
<div class="wrap cl pageinfo">
	<div id="nav">
		<%if {usergroupinfo.AllowSearch}%>
			<%template _quicksearch%>
		<%/if%>
		<a href="{config.forumurl}" class="title">{config.forumtitle}</a> &raquo; <a href="usercpprofile.aspx">用户中心</a> &raquo; <strong>收藏夹</strong>
	</div>
</div>
<!--body-->
<script type="text/javascript">
	function checkCheckBox(form,objtag)
	{
		for(var i = 0; i < form.elements.length; i++) 
		{
			var e = form.elements[i];
			if(e.name == "titemid") 
			{
				e.checked = objtag.checked;
			}
		}
		objtag.checked = !objtag.checked;
	}
</script>
<div class="wrap uc s_clear">
   <%template _menu%>
	<div class="uc_main">
	<div class="uc_content">
		<h1>收藏夹</h1>
		<%template _subscribemenu%>
<%if page_err==0%>
	<%if ispost%>
		<%template _usercpmsgbox%>
	<%else%>
	    <%if {favoriteCount}>0%>
		<form id="favlist" name="favlist" method="post" action="">
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="datatable">
			<tr class="colplural">
				<td width="4%">&nbsp;</td>
				<td width="44%" style="text-align: left;">标题</td>
				<td width="18%">作者</td>
                <%if {typeid}==0%>
                    <td width="18%">版块</td>
                <%/if%>
				<td>收藏时间</td>
				<td>&nbsp;</td>
			</tr>
			<tbody>
			<%loop (Favorite) fav Favorite.Search(userid,null,(FavoriteType)type,(pageid-1)*16,16)%>
			<tr>
			<td style="text-align:center;"><input name="titemid" id="id{fav.Tid}" type="checkbox" value="{fav.Tid}"/></td>
			<td>
			<%if {typeid}==1%>
				<a href="showalbum.aspx?albumid={fav.Tid}" target="_blank"><%getsubstring({fav.Title},30,"...")%></a>
			<%else if {typeid}==2%>
				<a href="space/viewspacepost.aspx?postid={fav.Tid}" target="_blank"><%getsubstring({fav.Title},30,"...")%></a>
			<%else if {typeid}==3%>
				<a href="showgoods.aspx?goodsid={fav.GoodsID]}">{fav.Title}</a>
			<%else%>
                <%if {fav.New}%>
                    <a href="{forumpath}showtopic.aspx?topicid={fav.Tid}&fromfav=1" target="_blank" title="{fav.Title}"><%getsubstring({fav.Title},30,"...")%></a>
                    &nbsp;<a href="{forumpath}showtopic.aspx?topicid={fav.Tid}&fromfav=1&page=end#lastpost" target="_blank" class="xg2" title="{fav.Title}">[有新回复]</a>
                <%else%>
                    <%set {aspxrewriteurl} = this.ShowTopicAspxRewrite({fav.Tid},0)%>
				    <a href="{aspxrewriteurl}" target="_blank" title="{fav.Title}"><%getsubstring({fav.Title},30,"...")%></a>
                <%/if%>
			<%/if%>
			</td>
			<td>
				<%set {aspxrewriteurl} = this.UserInfoAspxRewrite({fav.PosterID})%>
				<a href="{aspxrewriteurl}">{fav.Poster}</a>
			</td>
            <%if {typeid}==0%>
            <td>
                <%set (string){forumname} = GetForumName({fav.Fid})%>
                <%set {aspxrewriteurl} = this.ShowForumAspxRewrite({fav.Fid},0)%>
                <a href="{aspxrewriteurl}"><%getsubstring({forumname},10,"...")%></a>
            </td>
            <%/if%>
			<td>
                <%set (string){ftime} = ForumUtils.ConvertDateTime({fav[favtime]})%>
                {ftime}
            </td>
			<td class="delete_msg"><a href="#" onclick="$('id{fav.Tid}').checked=true;$('favlist').submit();"></a></td>
			</tr>
			<%/loop%>
			</tbody>
			</table>
		</form>
		<div class="pages_btns">
			<div class="pages">
			<em>{pageid}/{pagecount}页</em>{pagenumbers}
			</div>
			<a href="javascript:;" onclick="checkCheckBox($('favlist'),this)" class="selectall">全选</a>
			<span class="pipe">|</span>
			<a href="#" onclick="$('favlist').submit()" class="selectall">删除</a>
		</div>
		<%else%>
		<div class="zerothreads">暂无收藏的主题</div>
		<%/if%>
	<%/if%>
<%else%>
	<%template _usercperrmsgbox%>
<%/if%>
	</div>
	</div>
</div>
<%template _copyright%>
<%template _footer%>